Skip to content

Conversation

@wiktoriavh
Copy link
Member

@wiktoriavh wiktoriavh commented Nov 1, 2025

erDiagram
    User {
        int userId PK
        string discordUserId UK
        Role role
    }

    Action {
        int actionId PK
        int userId FK
        ActionType type
        ActionStatus status
        int moderatorUserId FK
        ActionReason reason
        string note
        int createdAt
        int expiresAt
        int revertingActionId FK
    }

    User ||--o{ Action : "receives actions"
    User ||--o{ Action : "moderates"
    Action ||--o| Action : "reverts"
Loading

@wiktoriavh wiktoriavh requested review from Copilot and hmd-ali November 9, 2025 15:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a database layer for moderation functionality using Prisma with SQLite. The implementation introduces a schema for tracking users, moderation actions, and their relationships, along with Docker configuration updates to support database migrations and persistence.

Key Changes:

  • Adds Prisma schema with User and Action models to track moderation events
  • Implements graceful shutdown handlers in the application entry point
  • Configures Docker volumes and migration service for database persistence

Reviewed Changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/index.ts Adds SIGINT/SIGTERM handlers for graceful shutdown
prisma/schema.prisma Defines database schema with User and Action models, enums for roles, action types, and statuses
prisma.config.ts Configures Prisma with schema path, migrations, and datasource
package.json Adds Prisma dependencies (@prisma/client, @prisma/adapter-better-sqlite3, prisma)
docker-compose.yml Updates volumes to named volumes and adds migrate service for running database migrations
Dockerfile Adds Prisma client generation steps and copies generated files to production image
prisma/migrations/*.sql Migration files for database schema evolution
prisma/migrations/migration_lock.toml Locks SQLite as the migration provider
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wiktoriavh wiktoriavh merged commit b798570 into main Nov 21, 2025
1 check passed
@wiktoriavh wiktoriavh deleted the feat/add-database branch November 21, 2025 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants